<%@ page contentType="text/html; charset=UTF-8"%>
<%@page import="frm.ssh.util.page.SearchBean"%>
<%@ include file="/jsp/common/common.jsp"%>
<html>
	<head>
		<script type="text/javascript" src="<%=contextPath%>/js/validator.js"></script> 
		<script type="text/javascript" src="<%=contextPath%>/js/jquery.autogrow.js"></script> 
		<script type="text/javascript" src="<%=contextPath%>/js/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript" language="javascript">  
			Ext.onReady(function(){
			
				var tb = new Ext.Toolbar({
			   		renderTo: document.all.tbar,
			    	items: [
				        {
				            text: '保存',
				            icon:"<%=contextPath%>/images/save.gif",
				            handler:toCheck,
				            hidden:<%=session.getAttribute("btn_scplan_save_display") != null || "1".equals(session.getAttribute("SESSION_ISADMIN")) ? false:true%>
				        },'-', {
				            text: '提交',
				            icon:"<%=contextPath%>/images/arrowclose.gif",
				            handler:submitPlan,
				            hidden:<%=session.getAttribute("btn_scplan_submit_display") != null || "1".equals(session.getAttribute("SESSION_ISADMIN")) ? false:true%>
				        },'-', {
				            text: '返回',
				            icon:"<%=contextPath%>/images/fanhui.png",
				            handler:function(){
				            	back();
				            }
				        }
			    	]
			    });
			});
		    
			function toCheck(){
				
			  	if(!Validator.Validate(frmM,2)){
				  return false;
			  	}
  				comt();
  			}
  			
  			function openShowDialog(){
  			 
			} 
		 </script>  
	</head>
	<body>
		<div id ='tbar'></div>
		<br>
		<div id="Layer" style="position:absolute;display:block left:0px; top:35px; width:100%; height:94%; z-index:1000; overflow:auto;">
		
		<!-- 信息提示 -->
		<div id="result" align="center"><font color="red">${info }</font></div>
		<table width="100%" height="30">
			<tr>
				<td colspan="4" align="center">&nbsp;临时生产工作安排&nbsp;</td>
			</tr>
			<form id="frmM" name="frmM" method="POST" action="<%=contextPath%>/entity!save.do">
			<s:hidden name="entity.id" />
			<table width="100%" id="infotab">
				
				<tr>
					<th width="120" ><font color="red">*</font>&nbsp;开始时间：</th>
					<td >
					   <input type="text" style="width:100;"  datatype="Require" onclick="WdatePicker({el:$dp.$('entity.startdate')})"    readonly="true" name="entity.startdate" value='<fmt:formatDate value="${entity.startdate}" pattern="yyyy-MM-dd"/>' msg="出具时间必须输入。" />
					   <img onclick="WdatePicker({el:$dp.$('entity.startdate')})" src="<%=contextPath%>/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
					</td>
					<th width="120" ><font color="red">*</font>&nbsp;结束时间：</th>
					<td >
					   <input type="text" style="width:100;"  datatype="Require" onclick="WdatePicker({el:$dp.$('entity.enddate')})"    readonly="true" name="entity.enddate" value='<fmt:formatDate value="${entity.enddate}" pattern="yyyy-MM-dd"/>' msg="出具时间必须输入。" />
					   <img onclick="WdatePicker({el:$dp.$('entity.enddate')})" src="<%=contextPath%>/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
					</td>
				</tr>
				<tr>
					<th width="120" ><font color="red">*</font>&nbsp;变电站：</th>
					<td >
					   <input type="text" datatype="Require" maxlength="10" style="width:50%" name="entity.stationname" value="${entity.stationname}" msg="变电站必须输入。" />
					   <img src="/DLPLANMIS/images/editlink.gif" title="选择机构" onClick="javascript:openStationTree()" />
					</td>
					<th width="120" ><font color="red">*</font>&nbsp;停电范围：</th>
					<td >
					   <input type="text" datatype="Require" maxlength="10" style="width:50%" name="entity.powerrange" value="${entity.powerrange}" msg="停电范围必须输入。" />
					</td>
				</tr>
				
				<tr>
					<th width="120" ><font color="red">*</font>&nbsp;电压等级：</th>
					<td >
					   <input type="text" datatype="Require" maxlength="10" style="width:50%" name="entity.voltagelevel" value="${entity.voltagelevel}" msg="电压等级必须输入。" />
					</td>
				</tr>
				<tr>
					<th width="120" ><font color="red">*</font>&nbsp;工作项目：</th>
					<td >
					   <input type="text" datatype="Require" maxlength="10" style="width:50%" name="entity.workcontent" value="${entity.workcontent}" msg="工作项目必须输入。" />
					</td>
				</tr>
				<tr>
					<th width="120" ><font color="red">*</font>&nbsp;班&nbsp;组：</th>
					 <input type="text" datatype="Require" maxlength="10" style="width:50%" name="entity.teamnames" value="${entity.teamnames}" msg="班组必须输入。" />
					 <img src="/DLPLANMIS/images/editlink.gif" title="选择班组" onClick="javascript:openTeamsTree()" />
				</tr>
			</table>
			</form>
		</table>
	</body>
</html>
<script language="javascript">
	 // 保存
     function save(){
     	document.frmM.action = "<%=contextPath%>/plan!save.do";
     	document.frmM.submit();
     }
     
     // 返回
     function back() {
     		location.href = "<%=contextPath%>/planList!getList.do";
     }
    // 提交
    function submitPlan() {
     	document.frmM.action = "<%=contextPath%>/plan!submit.do";
     	document.frmM.submit();
     }
    //选择变电站
    function openStationTree() {
        
        var strWindowURL="<%=contextPath%>/jsp/business/plan/selectStation.jsp";
        
    	var win = new Ext.Window({
        	
    		title   : "选择 变电站",
    		width   : 460,
    		height   : 478,
    		closable   : true,
    		modal   : true,
    		plain   : true,
    		//maximizable : true,
    		draggable   : false,
    		html   : '<iframe  src="' + strWindowURL + '" width="100%" marginwidth="0" height="100%" marginheight="0" scrolling="no" frameborder="0"></iframe>'
    		});

    		win.show(); 

    	//var win = window.open("<%=contextPath%>/jsp/business/plan/selectStation.jsp","Result_window","left=450,top=30,width=200,height=500,status=no,toolbar=no,autoscroll=yes,location=no,menubar=no,resizable=no",true);

    }
    //选择班组
    function openTeamsTree() {

    	var win = window.open("<%=contextPath%>/jsp/business/plan/selectTeams.jsp","Result_window","left=450,top=30,width=200,height=500,status=no,toolbar=no,autoscroll=yes,location=no,menubar=no,resizable=no",true);

    }

</script>
